package com.zz.tijian.handle.mq;

import com.zz.tijian.service.OrdersService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrderTimeoutConsumer {
    @Autowired
    private OrdersService ordersService;
    /*
     监听延迟队列也就是死信队列处理超时支付的订单
     */
    @RabbitListener(queues = RabbitMQConfig.ORDER_TIMEOUT_QUEUE)
    public void processOrderTimeoutMessage(String orderId) {
        System.out.println("Received order timeout message: " + orderId);
        // 在这里处理订单超时的逻辑，例如取消订单、通知用户等操作
    }
}
